package com.zhisheng.mapper;

import com.zhisheng.Dto.EmpDto;
import com.zhisheng.Dto.EmpLoginDto;
import com.zhisheng.pojo.Emp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

/**
 * 员工管理
 */
@Mapper
public interface EmpMapper {
    //分页查询
   /* @Select("select * from emp limit #{start},#{pageSize}")
   public List<Emp> getByPage(@Param("start") Integer start,@Param("pageSize") Integer pageSize);
    //查询总记录数
    @Select("select count(*) from emp")
    public Long getTotal()*/;
    //由分页插件自动添加limit和总数量
    @Select("select * from emp")
    public List<Emp> getByPage();
     //条件查询
    List<Emp> getByPage(EmpDto empDto);

    int deByIds(@Param("ids") Integer[] ids);

    @Select("select * from emp where username=#{username} and password=#{password}")
    Emp getByUsernameAndPassword(EmpLoginDto dto);
}
